UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xzBRqy+O+yipmdwpTBSKn5nLkL58Kmv0vnEFdx+9aQg='
WHERE
key_id = 'e548a632e87c7b68f79963725902ca01171653e8c11b50bbe26ca4ecce93bb6e'
AND (
token = 'xzBRqy+O+yipmdwpTBSKn5nLkL58Kmv0vnEFdx+9aQg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)