UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8aWtUJnXL5o55tkX2pjzco1Y2c2/SDwfzo69gfKOCTE='
WHERE
key_id = '0ae5943ffa8786bcb6562c749ab7bb3d2707b7ed1660ae147a27ec0d08c08fa9'
AND (
token = '8aWtUJnXL5o55tkX2pjzco1Y2c2/SDwfzo69gfKOCTE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)