UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+Kn5rHV0V+c9H+N0hcKlXQPuOkFHzICpz4XUfE/Ji4Y='
WHERE
key_id = '5b89430f8ba1890434ae257352e5ef241f4fc8024c4c7d93406cd3114e946bd8'
AND (
token = '+Kn5rHV0V+c9H+N0hcKlXQPuOkFHzICpz4XUfE/Ji4Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)