UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G/TCuNvyq7QyjFiHKS6Nl883MzSMkKetZbV4lNiyaiI=' 
WHERE 
  key_id = '0b9de06e06cf8797fa692f81e2f468397993c48d0aced0335dc9b20c08f380c3' 
  AND (
    token = 'G/TCuNvyq7QyjFiHKS6Nl883MzSMkKetZbV4lNiyaiI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036