UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dPzbmVvqIW7Cx+B3HGHBL+kxmlM/jOwB2HhlKfEtu1g=' 
WHERE 
  key_id = '66093dde511139fab4445b9acbfe19c6f625c3581280859fbc5f7f4f4ebb2faf' 
  AND (
    token = 'dPzbmVvqIW7Cx+B3HGHBL+kxmlM/jOwB2HhlKfEtu1g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056