UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TsBG1dYcLq64owgrNpnFBVGakgWqVMDwmH3U8l8tnBU='
WHERE
key_id = '0955e1d24749d4a54fac795201ea4f85c5a2be1076d7406e3d422ce4d7a7ae72'
AND (
token = 'TsBG1dYcLq64owgrNpnFBVGakgWqVMDwmH3U8l8tnBU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)