UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3UUhHhtaVosunA/5pNLg3lAPvkQbPqmb0r4/0XsZBY8=' 
WHERE 
  key_id = 'e9541e92b80403e827592a181e8d7d5cb18f243374f29e6bb6b452431f3439e3' 
  AND (
    token = '3UUhHhtaVosunA/5pNLg3lAPvkQbPqmb0r4/0XsZBY8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029