UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'txGyWTVgMxjOMsTawIbqNcBmnRwV2TbxEEp8PZZA8s4='
WHERE
key_id = '2212ec5caee3163ac6c72ae0171bf3055d44335cea4f2da5fb53375b09b80234'
AND (
token = 'txGyWTVgMxjOMsTawIbqNcBmnRwV2TbxEEp8PZZA8s4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)