UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yzxaBfw/wvTGp87VKsgmTWW6TknWGv4OCl/1ky1XDBI='
WHERE
key_id = 'c89accf8c66bed2b768f002d3d404b65f5b9b52622cb0a72198120d599de40cf'
AND (
token = 'yzxaBfw/wvTGp87VKsgmTWW6TknWGv4OCl/1ky1XDBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)