UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YghtMIdRUsuT9dJKk12FJZCgn11LAHgKWvZkRoWBtfo='
WHERE
key_id = '6136816d4cf2f6d5212a53cd118e07239816b3c3c9c0b434d526dc02af20404b'
AND (
token = 'YghtMIdRUsuT9dJKk12FJZCgn11LAHgKWvZkRoWBtfo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)