UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0wId9WCTezerkfGC7YbXyM+AosKL/6Ukc9pSrb2lhqs='
WHERE
key_id = '1961f90780b35ef8832fd2d3f8c034ef3c440a3df23ad41a3da0f769a64fc08a'
AND (
token = '0wId9WCTezerkfGC7YbXyM+AosKL/6Ukc9pSrb2lhqs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)