UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EqpKIeMztGU7VkYfShhVB1HeRASeOOzUaXG7zu8Vcic='
WHERE
key_id = '1724e723f15aba88e0212ede97ed06326b820bf9a1480d0373466e20c7f33556'
AND (
token = 'EqpKIeMztGU7VkYfShhVB1HeRASeOOzUaXG7zu8Vcic='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)