UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MqA1Kn/YIAV2+DTqmYjZPHzG8xDW2y5+uHjBk0IA4mc='
WHERE
key_id = '36fc8004f6057a3766cbb3f7f613d7bcc0bbedbf79011e8a0432ffaab99a745a'
AND (
token = 'MqA1Kn/YIAV2+DTqmYjZPHzG8xDW2y5+uHjBk0IA4mc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)