UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fqxMscwnlKu1+8+fGClHhXi9OMIjxYNcZkX76nOQq6c='
WHERE
key_id = '959b49a3f4a71462a684700fdbd35c9c564e8a9642f55ce5382de5d54ebede87'
AND (
token = 'fqxMscwnlKu1+8+fGClHhXi9OMIjxYNcZkX76nOQq6c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)