UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b+QuH0MGsWP0zVLB1iCabW88x1yOCWBOBXVn+4VGWtM='
WHERE
key_id = 'c28d0c869a482c93924f62b7f7ad00ad896b86acdbe928d5d9babaaa5bc793e9'
AND (
token = 'b+QuH0MGsWP0zVLB1iCabW88x1yOCWBOBXVn+4VGWtM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)