UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XCRuTchHhqp9Q4r4mVCytm1lwluV7nOuHW78MPQi0Jk='
WHERE
key_id = '6e5636486c971847af90ffe730c461ad4560a9ab2c6b8e0f60db3b1494c64891'
AND (
token = 'XCRuTchHhqp9Q4r4mVCytm1lwluV7nOuHW78MPQi0Jk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)