UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o3B1SDLqiMVPuiWPP4fL7FYRPbD/HrzomqUo77d8jj4='
WHERE
key_id = 'fc954903c7659c7f0c87d386465bf1b552358caed6f70394d4c747b7950d17cc'
AND (
token = 'o3B1SDLqiMVPuiWPP4fL7FYRPbD/HrzomqUo77d8jj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)