UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ddFHaA8TOf4e+PtciNHxgLGQA3FykY8C+ZzUzr7LZEw=' 
WHERE 
  key_id = '2f073302a78ea9d2d197dc0e7ebb9465d848e2c93dff3d8ae84affbc520e2a34' 
  AND (
    token = 'ddFHaA8TOf4e+PtciNHxgLGQA3FykY8C+ZzUzr7LZEw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018