UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4TXpQdwQyyu0gE8TKqXtnnQIdql1V0lH9mq8+qM6u+8=' 
WHERE 
  key_id = '88caaf3af34eff2c53e7f3492949c4c90b4e0fd06bd212648fb0bf5abdb7b4d3' 
  AND (
    token = '4TXpQdwQyyu0gE8TKqXtnnQIdql1V0lH9mq8+qM6u+8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032