UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jv4oVhiz8+CHcvFUsd2cOL/9ZNXkKp3hx7C09PjOTjc='
WHERE
key_id = '54bdd15cadd9eb6c7c4842559f7c98191e578ef43eb615ad70c19fcc2289082a'
AND (
token = 'Jv4oVhiz8+CHcvFUsd2cOL/9ZNXkKp3hx7C09PjOTjc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)