UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cyeQAiqOEIpAYub5D//IWz8OR0LY9KNR1fPhR7gs01o='
WHERE
key_id = 'c9a062927a92fabaea4f46c355cc9661fce4cb6b71b2ef51e749f941847399df'
AND (
token = 'cyeQAiqOEIpAYub5D//IWz8OR0LY9KNR1fPhR7gs01o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)