UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9D6Jrl934hF9ck6SqV6/iqVIt3KwyEqRZGP3Zi8mhAw='
WHERE
key_id = '99958f1e9515efd6dec7fe95c008671a25f4e141044cc3e7289e5e9255fa08cf'
AND (
token = '9D6Jrl934hF9ck6SqV6/iqVIt3KwyEqRZGP3Zi8mhAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)