UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ag7bWVBMEId3fiAYXD3nTOGuP3zzEi3/8vZLku4LoG4='
WHERE
key_id = '21b4d334541551ccb2cbe644f890ecd552a15f7a17f067fc2a53e11561a8cb83'
AND (
token = 'Ag7bWVBMEId3fiAYXD3nTOGuP3zzEi3/8vZLku4LoG4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)