UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8sLKBvQqDjH1YzEq7CcUwWa6JLy/4QR9iYQm1apX/5A='
WHERE
key_id = '552b846906b6262455fb754a872d803decbfa4d13613096c5747caafa57368e3'
AND (
token = '8sLKBvQqDjH1YzEq7CcUwWa6JLy/4QR9iYQm1apX/5A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)