UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a8+BdxgQT7gf+Sq3KzbCpBqg8TP25/ip0d25CFtHv28='
WHERE
key_id = '636d11769072be98811dff6d73d1f6a1ff8f8756791faf58e69ee9b0305a8d4d'
AND (
token = 'a8+BdxgQT7gf+Sq3KzbCpBqg8TP25/ip0d25CFtHv28='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)