UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oqpDClWZuhp2gQ1XOzmOFbIo5WGcbviPRJUq/YgkQBQ=' 
WHERE 
  key_id = '1604d14d4dd3385ffc0030f88c261023bf6f3ce5a16663943027b7d5ed26a99c' 
  AND (
    token = 'oqpDClWZuhp2gQ1XOzmOFbIo5WGcbviPRJUq/YgkQBQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045