UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zwusnP0AY1QZfrQDeeE86ZeoHlNo0fMdAuLk6/kohPs=' 
WHERE 
  key_id = '6f1d28f709a0833c66cd3c9271afe3108d2e539f4f9c19fc7672f0c50211008a' 
  AND (
    token = 'zwusnP0AY1QZfrQDeeE86ZeoHlNo0fMdAuLk6/kohPs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042