UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jn7n0r0Do7UV6K43ztWCyC4c0u6ZVzKRqY7RRKLARdQ=' 
WHERE 
  key_id = '849cd5d75c598e3fb8f9aadd08489e5186e68cecea91d159937362dd6420580d' 
  AND (
    token = 'jn7n0r0Do7UV6K43ztWCyC4c0u6ZVzKRqY7RRKLARdQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033