UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pmhObidZmllWjRNmrQuiTV9Eq+JR19dBTBVdAzsBOZY='
WHERE
key_id = 'ac7fefb5747191a5bd5aa9c2fafc81f14bf72f1bd364b683b4ae2279640d6bc6'
AND (
token = 'pmhObidZmllWjRNmrQuiTV9Eq+JR19dBTBVdAzsBOZY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)