UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TXfdqgbTN/m7GFcCGAmtQB3QgTC7Menhi9/yRk4I/9k='
WHERE
key_id = 'b3b207aa2dc25c4e46eafa6da6a7973a30a6e282d7ae4e0b9ab87cac3052950f'
AND (
token = 'TXfdqgbTN/m7GFcCGAmtQB3QgTC7Menhi9/yRk4I/9k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)