UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+uz6YYQu7vbsgEWMnmuEuOd2ysAqPyetOLhPCw30ev0='
WHERE
key_id = '7abdc48e0c8daf91add1b08c927300879847baec721419fdf025c58cb1cb44cc'
AND (
token = '+uz6YYQu7vbsgEWMnmuEuOd2ysAqPyetOLhPCw30ev0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)