UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EC4uTStJReJPvJ5S/nS8sy72CE7sWGiZre2WxK+/ysw='
WHERE
key_id = 'ea1a5f55e827d0e212ceef2ba2294770d11b08bcddec2e77ea1783e62db0ad64'
AND (
token = 'EC4uTStJReJPvJ5S/nS8sy72CE7sWGiZre2WxK+/ysw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)