UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WqmZp0vnzrZ3F+Cgce70r861mlDZmjpBd3osZco2JVM='
WHERE
key_id = '687de49394f1df900e5b68b8dde1738e30550ff52b3d348abaff4ced6f6e90cb'
AND (
token = 'WqmZp0vnzrZ3F+Cgce70r861mlDZmjpBd3osZco2JVM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)