UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7payVbaxKKtfo7Mwxku4F0QSEuFJphLV5r5QULdFBQM='
WHERE
key_id = 'ab5c95fad95bb80a448616a0550bd3d7fa1f045aceec506ff72ff8963bbd7b09'
AND (
token = '7payVbaxKKtfo7Mwxku4F0QSEuFJphLV5r5QULdFBQM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)