UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fVTNoq02H0xEtjHMlgMw9zcgO/+EwjGAYKVhE8meX08=' 
WHERE 
  key_id = '7da057764ec5326e85914de1e988d97e94cc5afdf4124d566ff7bc77da091ac6' 
  AND (
    token = 'fVTNoq02H0xEtjHMlgMw9zcgO/+EwjGAYKVhE8meX08=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050