UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+1Po/5O8/ydE7XBDnpupN+V0eFbAYK0SBKsTwAL3pSk='
WHERE
key_id = '3c2addd721eeed5d7cf4c06626edef1d47c18f84d7e2ae98024c7519588a3403'
AND (
token = '+1Po/5O8/ydE7XBDnpupN+V0eFbAYK0SBKsTwAL3pSk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)