UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AV3wmEyyxB/yjUMihzMtIHI6mHR3ip5zCagfZlM6w8I='
WHERE
key_id = '675689507722b9e1a024759791cfdd8fcc3934f80027ead0bf11c027acc96efd'
AND (
token = 'AV3wmEyyxB/yjUMihzMtIHI6mHR3ip5zCagfZlM6w8I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)