UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qsZfDmlRl7myfJxaWBFLcvjnDHEfzNpk+nFA00Hmtfo='
WHERE
key_id = '1b949e91d3547c3999441da595fd25a5af41f301ed2edd5c9a3af0066cb3d8aa'
AND (
token = 'qsZfDmlRl7myfJxaWBFLcvjnDHEfzNpk+nFA00Hmtfo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)