UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eHozk3oqmOyke18gTKpi629b1vdWmBE/4LUEeYhNIs4='
WHERE
key_id = '573f6d5a356c39667c3fca34fad6c178e400573178d62f72d5b63447b8e29de8'
AND (
token = 'eHozk3oqmOyke18gTKpi629b1vdWmBE/4LUEeYhNIs4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)