UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/WxG/8NIRUcZcN0yYu8D0yqMburNmEaYzv0xdL/DC/w='
WHERE
key_id = '98532c1bc362a01040800ce05a5b13be643f56e7de5a32e14be7ca44839418ed'
AND (
token = '/WxG/8NIRUcZcN0yYu8D0yqMburNmEaYzv0xdL/DC/w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)