UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F6ViwTq5k1QLm1CtdHsrPSr37PcFOyxXwSIFkjaVKUk=' 
WHERE 
  key_id = '41f65197b47ba7ef5a0aa81ede8b65964421c1e4637ce14840cc2e005dee8a41' 
  AND (
    token = 'F6ViwTq5k1QLm1CtdHsrPSr37PcFOyxXwSIFkjaVKUk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021