UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2agVGQqM/M58mgk7nV9diwYXSSU/0FVteWZj5NcvMLA='
WHERE
key_id = '7f1133ec0a96594c1b502ef4340a6394a62c76116436bc032c419846ec0c3467'
AND (
token = '2agVGQqM/M58mgk7nV9diwYXSSU/0FVteWZj5NcvMLA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)