UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r0LIbRLzTRsyzu5uqcCvjJfi23PedCPpK0S/MXxMNhQ=' 
WHERE 
  key_id = '6f88fd43fa0fa9ce7a232531def11f3c2f7ab46e6cb71bb72e662a8ed27140ba' 
  AND (
    token = 'r0LIbRLzTRsyzu5uqcCvjJfi23PedCPpK0S/MXxMNhQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049