UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tV3VF+bwW0tZZJ4EMQ4Dr3LXaaTkrqtBD69BM0tb3Qw=' 
WHERE 
  key_id = '2c60714d18de2521afda478a7bd321ed491425979c08fa739f6bf21adf3e460c' 
  AND (
    token = 'tV3VF+bwW0tZZJ4EMQ4Dr3LXaaTkrqtBD69BM0tb3Qw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033