UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zRksW//yEZ5OtlDvxz1T19K/kUxa8MYIgDsOaZ3S8Ck=' 
WHERE 
  key_id = '64138c67435c0e877c473e9b87c54a10e08ffc74265e46e8c10095573bee0e4b' 
  AND (
    token = 'zRksW//yEZ5OtlDvxz1T19K/kUxa8MYIgDsOaZ3S8Ck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034