UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1uwpyuEYbR2bgI4cSvhdXyoyU5Bdl/QnRrZnHstX+sM='
WHERE
key_id = 'b71c2284e9c38f52eb5e50efb9a9b9e01be362e2279a1d7a2a7fd6c35ef596e7'
AND (
token = '1uwpyuEYbR2bgI4cSvhdXyoyU5Bdl/QnRrZnHstX+sM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)