UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EIh6TQ7aB+cMmqEsC4QGn+QlBwZV/CRXUrsFC9NstK4=' 
WHERE 
  key_id = '5b99e35e81842f3528701cc0367a68cd0b53dad5df52d4c2f6a1040328b5b638' 
  AND (
    token = 'EIh6TQ7aB+cMmqEsC4QGn+QlBwZV/CRXUrsFC9NstK4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025