UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '76zlQ7DTp4ep9NT6OM+B19AugTEtROb4GcHJcy2eQYs='
WHERE
key_id = 'ca220b76ca46fbe69b22b19a1539239310ed08de181039aeef0b2fc28c7a8dcf'
AND (
token = '76zlQ7DTp4ep9NT6OM+B19AugTEtROb4GcHJcy2eQYs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)