UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SaU3U7FfGpDzXDJQv+GHAnrq8Tkce+Dm+r0ASrSOOpE=' 
WHERE 
  key_id = '0dda2d98a0b6b437d6814b16f6346510ce642a50db3e73e2db90084717a84a35' 
  AND (
    token = 'SaU3U7FfGpDzXDJQv+GHAnrq8Tkce+Dm+r0ASrSOOpE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021