UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cGllqBZ2ul/qc9KkxFZExLeBXgZWjvt8ve2OG4P5Vdw=' 
WHERE 
  key_id = '76fa63a199129200a54901a15eea3aef4fdb4dfb4e20b5b21398a95637621ae8' 
  AND (
    token = 'cGllqBZ2ul/qc9KkxFZExLeBXgZWjvt8ve2OG4P5Vdw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032